import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";
//----------------------------------------------------------------------------------------------------
// 查询风险单元列表
export function listRiskUnit(query) {
  return request({
    url: '/aqsc/riskunit/listlike',
    method: 'get',
    params: query
  })
}
// 查询风险分类列表
export function getClassList(query) {
  return request({
    url: '/aqsc/riskunit/Classlist',
    method: 'get',
    params: query
  })
}
// 查询职业病类型列表
export function getDiseasesTypeList(query) {
  return request({
    url: '/aqsc/riskunit/diseasesTypeList',
    method: 'get',
    params: query
  })
}
// 查询职业病列表
export function getDiseasesList(query) {
  return request({
    url: '/aqsc/riskunit/diseasesList',
    method: 'get',
    params: query
  })
}
// 查询事故列表
export function getAccList(query) {
  return request({
    url: '/aqsc/riskunit/accList',
    method: 'get',
    params: query
  })
}
// 查询风险分区列表
export function getManagementList(query) {
  return request({
    url: '/aqsc/management/list',
    method: 'get',
    params: query
  })
}
//----------------------------------------------------------------------------------------------------
// 根据id查询风险单元详细
export function getRiskUnitById(id) {
  return request({
    url: '/aqsc/riskunit/' + parseStrEmpty(id),
    method: 'get'
  })
}
//----------------------------------------------------------------------------------------------------
// 新增风险单元
export function addRiskUnit(data) {
  return request({
    url: '/aqsc/riskunit',
    method: 'post',
    data: data
  })
}
//----------------------------------------------------------------------------------------------------
// 修改风险单元
export function updateRiskUnit(data) {
  return request({
    url: '/aqsc/riskunit',
    method: 'post',
    data: data
  })
}

// 删除风险单元
export function delRiskUnit(id) {
  return request({
    url: '/aqsc/riskunit/' + id,
    method: 'delete'
  })
}
//文件上传
export function uploadPic(data){
  return request({
    uri: '/file/upload',
    method: 'post',
    data: data
  })
}


